<?php

namespace app\index\controller;

use League\Flysystem\Cached\Storage\Predis;
use think\facade\View;
use think\facade\Request;

class Product extends Base
{
    public function index()
    {	

        $name = Request::param('name');
        $category = Request::param('category');
        
        if ((!$name && $category=="patch") ||( !$name && !$category)){
            return View::fetch('index');
        }
        if (!$name &&$category){
            return View::fetch($category);
        }
        
        //todo
        return View::fetch($name);

    }



	//全局MISS路由
	public function miss()
    {
		View::assign('title','不要瞎猜哦');
		return View::fetch('miss');
    }
}
